package com.example.springboot01.service.impl;

import com.example.springboot01.mapper.StudentMPMapper;
import com.example.springboot01.mapper.TeacherMapper;
import com.example.springboot01.model.Student;
import com.example.springboot01.model.Teacher;
import com.example.springboot01.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @Auther: zrd
 * @Date: 2022/5/4/05/04/10:40
 * @Description: com.example.springboot01.service.impl
 */
@Service            //注入springboot  IOC容器
@Transactional      //使用数据库事务
public class StudentServiceImpl implements IStudentService {
    @Autowired
    private StudentMPMapper studentMPMapper;
    @Override
    public Student get(int id) {
        return studentMPMapper.selectById(id);
    }
}
